1

私の問題は私がここで見つけた質問に似ています:

テーブルセル幅の計算におけるクロム対FF/IE /オペラ?(テーブルレイアウト:固定)

ページを簡略化しました。このページには、すべてのブラウザで同じように見えるテーブルが含まれていますが、Chromeです。問題はパディング(修正方法がわからない)またはdoctype(doctypeについてあまりよく知らない)だと思います...Chromeビューを他のブラウザと同じにするのを手伝ってください。ありがとうございました。以下は私のhtmlページです:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>

<title>Looks different in Chrome vs FF, IE, Opera</title>

<style>


table.maintable {
    background-color:yellow;
    border: 1px solid red;
    border-spacing:0;
    border-collapse:collapse;
    table-layout:fixed;
    word-wrap:break-word;

}

table.maintable th, table.maintable td {
    border: 1px solid red;
    margin:0;
    padding:14px;
}


</style>

</head>


<body>
I want the date look like 05/10/2011, in 1 string. Chrome cuts the date into 2 parts. All other browsers are OK.  The problem is style <u>padding:14px;</u>, but we need some padding in cells. <br>
Also <b>table-layout:fixed;</b> and <b>word-wrap:break-word;</b> are needed because any long text without any spaces will not destroy the table size in this case. How to make Chrome look like any other browser?
<table class="maintable" style="width:510px;"><tbody>
<tr><th style="width:57px;">number number</th><th style="width:75px;">date</th><th>current info</th><th style="width:90px;">more</th></tr>
<tr><td><a href="http://google.com">40</a></td>
    <td>05/10/2011</td>
    <td><a href="http://google.com">2 lines in Crhome but 3 lines in other browsers. Also check the date.</a></td>
    <td><a href="http://google.com">more...</a></td>
</tr>
</tbody>
</table>   

</body></html>

私の最初の文字列(doctype宣言)が間違っていると思われる場合は、適切な文字列を見せてください。キリル文字の1つの言語のWebサイト。xmlは使用されません。ありがとうございました。

4

1 に答える 1