html - 如何使文本环绕表格,就好像它是图像一样

标签 html css tabular

我很惊讶我找不到解决这个问题的方法。我想在我的文档顶部附近放置一个小表格(1 行,3 个单元格),向右对齐,用一个段落环绕它,就像您可以使用以下代码处理图像一样......

    <img src="http://www.sorenwagner.ws/marty/img/ca-seal.jpg"
        align="right" width="300" height="100">
    This is a paragraph large enough to wrap around the image...
    This is a paragraph large enough to wrap around the image...
    This is a paragraph large enough to wrap around the image...
    This is a paragraph large enough to wrap around the image...

如果能够定义表格周围的填充也很好,这样文本就不会正好到边框。在 CSS 中是否有相对简单的解决方案?

最佳答案

只是float右边的表格(这也是您应该如何定位图像的方式):

<table style="float: right">
    <!-- ... -->
</table>
<p>Bunch of text...</p>

演示:http://jsfiddle.net/ambiguous/ZLfg7/1/

关于html - 如何使文本环绕表格,就好像它是图像一样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10670353/

相关文章:

javascript - 如何让 block 元素高度自动而本身没有子元素

javascript - 无法让滑出菜单正常显示

css - 从 ul 元素制作一个表格,在 CSS 中没有顶部和侧面边框

javascript - 说明【随机列表】

html - 使包装器 div 覆盖内部所有定位的 div

html - 如何在laravel中使用excel export在一个单元格中显示多行数据

css - 'required' css 选择器语法

javascript - 无法在 iframe 内移动滚动条

html - CSS:强制三列表的两列宽度相同

python - 从具有缺失值的 Python 嵌套字典构建表