C
C
ChemAli2010-11-02 15:52:27
css
ChemAli, 2010-11-02 15:52:27

Background image for TR renders crookedly in Safari?

Set the background for table rows like this:

table tr {<br/>
 background: url(derevo.png) bottom repeat-x;<br/>
}

Firefox, Opera show normally, the background of the table row is monolithic:
Snymok_ekrana_2010-11-02_v_10.27.48.png
And Safari with Chrome renders the background separately for each cell of the table, which makes the joints visible:
Snymok_ekrana_2010-11-02_v_10.28.07.png
Apparently, this is due to the laziness of engine developers - after all, rows of tables are rarely rendered and there is a
temptation to simplify your task, taking care only of rendering cells. A quick Google search showed that the problem is old and widely known, even IE has been ill with it or at least can survive with a small and valid crutch.
Can this be done normally or is it better to look for tricky and crooked solutions?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
ChemAli, 2010-11-02
@ChemAli

He asked himself - he answered himself: let's make the rows and cells of the table forget that they should behave like a table.
tr {display: block;}
td {display: inline-block; background: transparent;}
And after small adjustments in size (the cells fell into a heap), everything falls into place.

K
Konstantin Kitmanov, 2010-11-02
@k12th

And if

table tbody { background: url(derevo.png) repeat-x repeat-y; }

?

M
Mikhail Krainov, 2010-11-03
@medved13

The same garbage occurs if you set the background for tbody. At the time, I couldn't decide. I had to redo the table logic so as not to use the background for tr and tbody.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question