From 541043389c16f079eb7c25f3abca514d388ee20e Mon Sep 17 00:00:00 2001
From: Fil <fil@rezo.net>
Date: Mon, 9 May 2005 12:52:01 +0000
Subject: [PATCH] dans les tables : caption et summary

---
 ecrire/inc_texte.php3  | 12 ++++++++----
 ecrire/spip_style.php3 |  4 +++-
 spip_style.css         |  2 ++
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ecrire/inc_texte.php3 b/ecrire/inc_texte.php3
index 9be872f301..f943c36c3a 100644
--- a/ecrire/inc_texte.php3
+++ b/ecrire/inc_texte.php3
@@ -692,10 +692,14 @@ function traiter_tableau($bloc) {
 
 		// Gestion de la premiere ligne :
 		if ($l == 1) {
-		// - <caption> sous forme de ||xxx|| en premiere ligne
-			if (preg_match(',^\|\|([^|]*)\|$,ms', $ligne, $caption)) {
-				$debut_table .= "<caption>".$caption[1]."</caption>\n";
+		// - <caption> et summary dans la premiere ligne :
+		//   || caption | summary || (|summary est optionnel)
+			if (preg_match(',^\|\|([^|]*)(\|(.*))?\|$,ms', $ligne, $cap)) {
 				$l = 0;
+				if ($caption = trim($cap[1]))
+					$debut_table .= "<caption>".$caption."</caption>\n";
+				if ($summary = trim($cap[3]))
+					$summary = ' summary="'.entites_html($summary).'"';
 			}
 		// - <thead> sous la forme |{{titre}}|{{titre}}|
 		//   Attention thead oblige a avoir tbody
@@ -732,7 +736,7 @@ function traiter_tableau($bloc) {
 		}
 	}
 
-	return "\n\n</no p><table class=\"spip\">\n"
+	return "\n\n</no p><table class=\"spip\"$summary>\n"
 		. $debut_table
 		. "<tbody>\n"
 		. join ('', $html)
diff --git a/ecrire/spip_style.php3 b/ecrire/spip_style.php3
index fd637f8830..c80e59080a 100644
--- a/ecrire/spip_style.php3
+++ b/ecrire/spip_style.php3
@@ -1354,7 +1354,9 @@ table.spip {
 }
 
 table.spip caption{
-	caption-side: top;
+	caption-side: top; /* bottom */
+	text-align:center;
+	background-color: #FCF4D0;
 }
 
 table.spip tr.row_first {
diff --git a/spip_style.css b/spip_style.css
index a683aa2a88..21eae69b65 100644
--- a/spip_style.css
+++ b/spip_style.css
@@ -58,6 +58,8 @@ table.spip {
 
 table.spip caption{
 	caption-side: top; /* bottom */
+	text-align:center;
+	background-color: #FCF4D0;
 }
 
 table.spip tr.row_first {
-- 
GitLab