News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Allign left

Started by Grim Line, July 15, 2010, 06:06:25 PM

Previous topic - Next topic

Grim Line

How would i allign this HTML coding to the left? I have searched in google but all codes i try have no effect.

<table border="0" width="100%" class="stats" style="class: left; margin-top: -4px"><thead><tr><th class="left">#</th> <th class="left"><br /></th> <th class="left"><br /></th> <th class="team_name">Team</th> <th class="left">P</th> <th class="left">W</th> <th class="left">D</th> <th class="left">L</th> <th class="left">GF</th> <th class="left">GA</th> <th class="left">GD</th> <th class="left">Pts</th> </tr></thead>

Joker™

Quote from: Grim Line on July 15, 2010, 06:06:25 PM
<table border="0" width="100%" class="stats" style="class: left; margin-top: -4px"><thead><tr><th class="left">#</th> <th class="left"><br /></th> <th class="left"><br /></th> <th class="team_name">Team</th> <th class="left">P</th> <th class="left">W</th> <th class="left">D</th> <th class="left">L</th> <th class="left">GF</th> <th class="left">GA</th> <th class="left">GD</th> <th class="left">Pts</th> </tr></thead>

have you declared that "left" class in your index.css ?

try making it like this

<th style="align:left">
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Grim Line

Tried adding it in but it just messed the page up and put everything to the left outside of the forums scrolling distance.

kat

What about

<p class="alignLeft">This text is left aligned.</p>

Would that do it?

Antechinus

Give us more info. Link to the page or a file or something. ;)

Grim Line

#5
As you can see it's the top  " #  Team P W D L GF GA GD Pts " that looks dodgey. The coding is messy anyway but it will take ages to redo.

Antechinus

Forget messing with the markup. Leave that how it was and try this in the CSS:

table.stats th
{
    text-align: left;
}


If that doesn't work you could use the following, but I prefer to do things with CCS if possible as in general it gives faster loading and less bandwidth usage.

<th align="left">

Note that the suggestion provided by Joker was invalid code. If you want to use styles you have to use CSS attributes, which in this case is text-align, whereas if you are using align directly on table elements you do it as above. 

Grim Line

#7
Is there anyway to completely redo the table using Excel then coverting the table into Html coding? I read up to save the document as a web page which turns the document into a .htm and loads via the web but i found no way of retreiving a html code from it.

EDIT: scratch that question i've found the answer. Also i added what you said to and it worked fine. Thankyou very much for your time :).

Antechinus

Why on earth would you want to use Excel for web coding? I assume you're just running that table code in an html portal block or something. I don't use Simple Portal so I'm not sure how their pages system works. What did you actually use to start with and why would you want to completely re-do it?

ETA: Ok. :)

Grim Line

Well the table will have to be changed once a week including new scores and who's in 1st-20th. I figure the best program to use would be Excel as it's easy and would take no time at all. I then save it as a HTM document transfer it on to Dreamweaver then copy and paste the html code into SP pages. Hopefully that's the plan anyway :)

Antechinus

Must admit I never use Excel or Dreamweaver for anything. I'd just edit the content in Notepad++ like any other code file. All you're doing is changing a few numbers and names. The SP admin editor should show the code that is currently running and if it is cleanly formatted (proper indentation, etc) then changing the cell content should be easy. You could just have it saved in a file on desktop, type in the changes, copy/paste, all done.

Grim Line

The table will be editted by a friend that has no experience in coding, so i have to find a way to make it easy. Of course i will look it over and be doing it myself sometimes aswell but if i do it via excel i can just have to excels open and c+p rows into the new possitions on another excel. It is a 21x11 table after all.

Advertisement: