commit e2fa3cb6ef0e65704402570d56086deca7643828
Author: Richard Heck <[email protected]>
Date: Sat Jul 30 19:41:51 2016 -0400
Fix output of table borders for XHTML. Fixes bug #10154.
---
lib/layouts/stdinsets.inc | 13 +++++++++++++
src/insets/InsetTabular.cpp | 8 +-------
src/insets/InsetTabular.h | 3 +++
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc
index a40572f..e6a4641 100644
--- a/lib/layouts/stdinsets.inc
+++ b/lib/layouts/stdinsets.inc
@@ -618,3 +618,16 @@ End
InsetLayout PrintNomencl
HTMLTag h2
End
+
+InsetLayout Tabular
+ HTMLStyle
+ table {
+ border-collapse: collapse;
+ display: inline-block;
+ }
+ td {
+ border: 1px solid black;
+ padding: 0.5ex;
+ }
+ EndHTMLStyle
+End
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 2f2c372..e83c895 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -5092,13 +5092,7 @@ docstring InsetTabular::xhtml(XHTMLStream & xs,
OutputParams const & rp) const
void InsetTabular::validate(LaTeXFeatures & features) const
{
tabular.validate(features);
- // FIXME XHTML
- // It'd be better to be able to get this from an InsetLayout, but at
present
- // InsetLayouts do not seem really to work for things that aren't
InsetTexts.
- if (features.runparams().flavor == OutputParams::HTML)
- features.addCSSSnippet(
- "table { border: 1px solid black; display:
inline-block; }\n"
- "td { border: 1px solid black; padding: 0.5ex; }");
+ features.useInsetLayout(getLayout());
}
diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
index 4b8ce59..1e1379c 100644
--- a/src/insets/InsetTabular.h
+++ b/src/insets/InsetTabular.h
@@ -981,6 +981,9 @@ public:
void completionPosAndDim(Cursor const &, int & x, int & y, Dimension &
dim) const;
///
virtual bool usePlainLayout() const { return true; }
+ ///
+ docstring layoutName() const { return from_ascii("Tabular"); }
+
///
InsetTabular * asInsetTabular() { return this; }