tags:

views:

31

answers:

4

hi,

I wanted to know if I customize a table with <td> and <tr> elements in the same way I usually customize <div> elements of a page.

I'm asking this because I cannot modify the generated html code, and I would like for example to float the rows to right, or to add padding, margin.

Is CSS working perfectly on <tr> or <td> elements ? (I am asking you this before to start).

thanks

A: 

You can edit the CSS, but not the HTML right? Yes, you can sort of do that. Can you provide an example?

buildakicker
A: 

Is CSS working perfectly on or elements ? (I am asking you this before to start).

Yes, you can apply css to any element. By the way, you can choose the direction of TDs by specifying align="left" or align="right". No need to float them. You could have provided sample of what you want to achieve though.

Sarfraz
+1  A: 

"I am asking you this before to start".

That's a bit stupid (no(t too much) offense) don't you think?

If you had give it a try you would have seen that there's no problem. Just be aware that default style is not the same and that there are some constraint due to the displaying of table element (which you can get rid of by using the css display property).

p4bl0
yeah I agree on you. But I have to make some decisions about the generated html. And the css come later, so I wanted to know if displaying the content as table is a strong limitation for css.
Patrick
In that case fire up your firebug and just try some stuff in live on your webpage ;-).
p4bl0
A: 

It all depends what you want to do. If you want to apply custom floating to particular cells (using CSS float) you might get crazy results because you mock around with box-model of <td> element.

If you want to float the text/content inside, you can always use text-align:left / right / center.

Again - if you want to affect content of the TD it should be relatively same as if you used <div>. If you want to affect td itself you might get unexpected results especially around position, float, z-index, display CSS attributes.

rochal