html - 表 rowspan 错误 html 和 css

标签 html css html-table

在我的表格图像(左列)中不起作用。它具有用于 tbodytdtr 的默认 CSS 规则(来自模板)。

screen shot

我在 table 外使用了 div 并为所有元素赋予了新的 id 和/或 class 属性。

样式表指定了vertical-align:baseline,但我不想要那样。

HTML

<div class= "search-result-table">
    <table class="job-search-result">                                               
        <tr class="job-search-result-row">
            <td class="job-search-img" rowspan="4">
                <img class="job-search-image" src="../images/test-img.jpg" alt="company logo"> </td>
            <td class="job-search-job-title"> Job Title</td>
            <td class="job-view" rowspan="4">
            <button type="button" value="view"> View </button>
            </td>
            </tr>
            <tr>
            <td class="job-search-compay-name"> Company Name </td>
            </tr>
            <tr>
            <td class="job-search-location-date"> Job Location and Date posted</td>
            </tr>
            <tr>
            <td class="job-search-job-detail"> <a href="">More about ths job</a></td>
            </tr>
            </table>
            </div>

CSS

.job-search-result { border: solid 1px black; font-family: inherit; }
.job-search-result { vertical-align: middle;    }
.job-search-img { width: 25%; } 
.job-search-img img { width: 150px; height: 150px; } 
.job-search-job-title { width: 65%; margin-top: 0em; padding-top: 0em;  }
.job-view { width: 10%; }

最佳答案

我的结果应该是这样的 enter image description here

但它看起来像下面..它从我的模板中继承了一些 css

enter image description here

关于html - 表 rowspan 错误 html 和 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31927804/

相关文章:

javascript - 如何使用react js过滤html表的所有列?

html - 使用 Perl 正则表达式计算 html 标签数量

Javascript src 属性不起作用

jquery - 如何居中对齐向下箭头?

c# - 在母版页的代码后面更改样式表

php - 在单个表中添加多个数组

html - 如何设置图标旁边的列表和段落的样式?

javascript - Bootstrap 模式,陷阱选项卡键

html - 在导航栏中将文本或图像居中

html - 如何使元素宽度为 : 100% minus padding?