Jump to content

[XHTML] Little help


Dirx

Recommended Posts

OK, I'm trying to get one table to be the same height as the cell it's in, and it dosn't seem to be working with 100% as a hight attrabute, in both the css and the main page.Could anyone tell me how to make a table cented on the page using XHTML, either in the document it self or in the css. I've got it currantly in the CSS but it dosn't work in Firefox, only IE...Which is a very odd thing Considering IE.Any help? Also why dosn't XHTML like (height="100%")? Ran it through the validator and it dosn't like it..."there is no attribute "height""

Link to comment
Share on other sites

you have to use CSS for all your styling in XHTML. As for your problem, make sure you have no padding in the cell and no margins in the table. As for centering, I believe you have to set the container to "text-align: center;" and the centered object to "margin: auto;"

Link to comment
Share on other sites

As for your first problem, you shoud give the containing cell a fixed height value, like this:<td height="100">  <table height="100%"  border="0" cellpadding="0" cellspacing="0">      <tr>        <td> </td>      </tr>  </table></td>

Yes, But this is Html, and for Xhtml it is forbidden to use height="". But why do you have a table inside another table(cell)? If you are able to write advanced CSS, you might even not need tables at all :)Well, try this:
<td style="height:123px">  <table style="height:100%">    <tr style="height:100%">      <td style="height:100%">something in here</td>    </tr>  </table></td>
Because the style attribute is not inherited. Or use classes instead, while the styles are inside your CSS.
Link to comment
Share on other sites

The thing is, Making the cell a set height will force it to stay at that height, correct?Like If I put some thing in the cell next to it that gose beyond say 100px, will the cell(The one with the table) change?ExampleVisual Aid :)Table 1, Cell A Changes height depending on what gose in there, Meaning No Set Height. Table 2, Cell A Changes depending on what gose in to Table 1, Cell A. (So it matches the height)Get what i'm meaning?And Advanced CSS? There is Advanced Css...And i'm not anywhere close to compleatly understanding Css as it is.

Link to comment
Share on other sites

Uh, I don't think you can set a height to a table, since it depends on the table's content.Either way, you should never have to put a table inside a table cell.Remember to use tables only for what they're meant for. To display tabular data, like a calendar, a schedule, etc.

Link to comment
Share on other sites

No, not correct. Tables may be used with and by anything you like. And what you want with this table inside a table can and may be done in Xhtml, but different to what you learned at Html lessons.One cell can be filled in a container cell, but there is no such thing as one cell without a table to support it. So the cell that you want to fill inside somewhere, must be inside another table. You wrote in Html the sollution, and that would work. But in Xhtml, it must be defined as styles, which, inline, are not inherited. So every parent of the filling cell untill the cell it should be in must get a height specification to 100%.It does not matter if the containing cell is 100px or also 100% of its own parent.

Link to comment
Share on other sites

OK, Here is what i've got, I think you will understand what i'm aiming for once you see it a bit better.Screen ShotAs you can see, It's rather, well, Full, with out having things in it :).The part with Content will be where i put things, I want the Gray "Middle" Bit to "Follow" that Down the page, Just becouse I do, It will not do anything, just for looks. So, A: Is this able to be Put into Xhtml, and get the effect i want?and B: What do you think about it? (This isn't relly directed to any one person)EDIT: Just read Dan's Post.I understood that, But just for the people who didn't, Could you say that again, so it can be understood by less clued in HTML/XHTML people? :)

Link to comment
Share on other sites

This is possible, am I right?Not difficult at all, just place the Content cell and the gray thing in one table, the gray cell with height:100% and that table just as you want it to.I would be glad to code it for you, if you could just give me your current version :)

Link to comment
Share on other sites

ahh, disrecard that end bit on my last Post...I understand now :).I downloaded HTML-Kit the other day (stupid thing can't convert to XHTML, even though it says it can) That said, it only misses the Doctype.I'm able to code it my self, Just may take a whil....My head went Boom when i was learning Macro's for MSword :)Speaking of HTML-Kit, is there a Better programe that converts HTML to XHTML?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...